﻿<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="author" content="">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" href="{$shopconfig.logo}" />
    <title>{$shopconfig.shopName}</title>
    <link rel="stylesheet" href="/shop/templates/cdrt/css/index.css?v=1.1">
    <link rel="stylesheet" href="/Content/amazeui/css/amazeui.min.css?v=1.0">
    <link href="//cdn.bootcss.com/Swiper/3.3.1/css/swiper.min.css" rel="stylesheet">
    <script>
        function jump(url) {
            self.location = url;
        }
    </script>
</head>
<body>
    <vt:template id="header" file="_header.html" charset="utf-8" />
    <!--焦点图-->
    <section data-am-widget="slider" class="am-slider am-slider-default am-slider-white" data-am-slider='{"directionNav":false}'>
        <ul class="am-slides">
            <vt:function var="hdp" method="getHdp" type="$this" rows="10" />
            <vt:foreach from="$hdp" item="p" index="i">
                <li>
                    <img src="{$p.bannerPicUrl}" onclick="jump('{$p.bannerLinkUrl}')">
                    <div class="am-slider-desc">{$p.Remark}</div>
                </li>
            </vt:foreach>
        </ul>
    </section>
    <!--类别-->
    <section class="am-padding">
        <div class="swiper-container ">
            <div class="swiper-wrapper">
                <vt:function var="category" method="getCategory" type="$this" parentid="0" />
                <vt:foreach from="$category" item="#.data" index="i" groupsize="4">
                    <div class="swiper-slide">
                        <vt:foreach from="$#.data" item="#.item" index="#.j">
                            <div class="category-item">
                                <vt:if var="item.link_url" value="" compare="==">
                                    <a href="{$item.id call='GetNewsUrl'}">
                                        {$item.title}
                                    </a>
                                    <vt:else>
                                        <a href="{$item.link_url}">
                                            {$item.title}
                                        </a>
                                </vt:if>
                            </div>
                        </vt:foreach>
                    </div>
                </vt:foreach>

            </div>
        </div>
    </section>
    <!--新品首发-->
    <section class="am-padding-sm am-padding-top-0">
        <div class="title">
            <div class="main-title">新品发布</div>
            <div class="sub-title">New arrival</div>
        </div>
        <ul data-am-widget="gallery" class="am-gallery am-gallery-white am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-overlay">
            <vt:function var="hdp" method="getLatest" type="$this" rows="2" />
            <vt:foreach from="$hdp" item="p" index="i">
                <li>
                    <div class="am-gallery-item">
                        <a href="{$p.link_url}" class="">
                            <img src="{$p.productpic}" alt="" />
                            <div class="am-gallery-info">
                                <div class="am-gallery-info-title">{$p.productName}</div>
                                <div class="am-gallery-info-desc">
                                    <span class="text">
                                        {$p.shortDesc length="46"}<br />
                                        <!--{$p.sku}-->
                                    </span>
                                    <span class="price">
                                        {$p.salePrice}<i>元</i>
                                    </span>
                                </div>
                            </div>
                        </a>
                    </div>
                </li>
            </vt:foreach>
        </ul>
    </section>
    <!--热卖-->
    <section class="am-padding-sm am-padding-top-0">
        <div class="title">
            <div class="main-title">热卖</div>
            <div class="sub-title">Best commdities</div>
            <a class="more" href="/shop/list.aspx?wid={$wid}&openid={$openid}&cid=0">
                更多优惠>
            </a>
        </div>
        <ul data-am-widget="gallery" class="am-gallery am-gallery-white am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-overlay">
            <vt:function var="hdp" method="getHotsalet" type="$this" rows="2" />
            <vt:foreach from="$hdp" item="p" index="i">
                <li>
                    <div class="am-gallery-item">
                        <a href="{$p.link_url}" class="">
                            <img src="{$p.productpic}" alt="" />
                            <div class="am-gallery-info">
                                <div class="am-gallery-info-title">{$p.productName}</div>
                                <div class="am-gallery-info-desc">
                                    <span class="text">
                                        {$p.shortDesc length="46"}<br />
                                        <!--{$p.sku}-->
                                    </span>
                                    <span class="price">
                                        {$p.salePrice}<i>元</i>
                                    </span>
                                </div>
                            </div>
                        </a>
                    </div>
                </li>
            </vt:foreach>
        </ul>
    </section>
    <!--特价-->
    <section class="am-padding-sm am-padding-top-0">
        <div class="title">
            <div class="main-title">特价</div>
            <div class="sub-title">Promotion</div>
        </div>
        <ul data-am-widget="gallery" class="am-gallery am-gallery-white am-avg-sm-2 am-avg-md-3 am-avg-lg-4 am-gallery-overlay">
            <vt:function var="hdp" method="getSpecialOffer" type="$this" rows="2" />
            <vt:foreach from="$hdp" item="p" index="i">
                <li>
                    <div class="am-gallery-item">
                        <a href="{$p.link_url}" class="">
                            <img src="{$p.productpic}" alt="" />
                            <div class="am-gallery-info">
                                <div class="am-gallery-info-title">{$p.productName}</div>
                                <div class="am-gallery-info-desc">
                                    <span class="text">
                                        {$p.shortDesc length="46"}<br />
                                        <!--{$p.sku}-->
                                    </span>
                                    <span class="price">
                                        {$p.salePrice}<i>元</i>
                                    </span>
                                </div>
                            </div>
                        </a>
                    </div>
                </li>
            </vt:foreach>
        </ul>
    </section>
    <input type="hidden" value="{$wid}" id="hidwid" name="hidwid">
    <input type="hidden" value="{$openid}" id="openid" name="openid">
    <vt:template id="_bottom" file="_bottom.html" charset="utf-8" />
    <script src="/Content/jquery/jquery-1.12.1.min.js"></script>
    <script src="//cdn.bootcss.com/Swiper/3.3.1/js/swiper.jquery.min.js"></script>
    <script src="/Content/amazeui/js/amazeui.min.js"></script>
    <script src="/Content/jquery-ui/jquery-ui.min.js"></script>
    <script src="/shop/templates/cdrt/js/index.js?v=1.0"></script>
    <script>
        $(function () {
            $.getJSON("/shop/shopmgr.ashx?wid={$wid}&openid={$openid}&myact=pcount&v=" + Math.random(),
        function (d, status) {
            $("#count").text(d.data);
        });

            $("#search1").autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "/shop/shop.ashx?wid={$wid}&openid={$openid}&myact=sousuo",
                        dataType: "jsonp",
                        data: {
                            name: $("#search1").val()
                        },
                        success: function (data) {
                            response($.map(data.geonames, function (item) {
                                return {
                                    label: item.productName,
                                    value: item.name
                                }
                            }));
                        }
                    });
                },
                minLength: 2,
                select: function (event, ui) {
                    log(ui.item ?
            "Selected: " + ui.item.label :
            "Nothing selected, input was " + this.value);
                },
                open: function () {
                    $(this).removeClass("ui-corner-all").addClass("ui-corner-top");
                },
                close: function () {
                    $(this).removeClass("ui-corner-top").addClass("ui-corner-all");
                }
            });

            $('#btnSearch').click(function () {
                var keyword = encodeURI($('#search1').val());

                if (keyword.trim() == '') {
                    alert('请输入商品名称!');
                }
                else {
                    jump('list.aspx?wid={$wid}&cid=0&keyword=' + keyword);
                }
            });

            var mySwiper = new Swiper('.swiper-container', {

                loop: true

            });
        });
    </script>
</body>
</html>
